package com.zhl.math;

public class Runtime2 {
    public static void main(String[] args) {
        Runtime r = Runtime.getRuntime();
        //查看虚拟机能够使用的处理器数量
        System.out.println(r.availableProcessors());
        //查看JVM总内存
        System.out.println(r.totalMemory()/1024+"KB");
        System.out.println(r.totalMemory()/1024/1024+"MB");
        //查看JVM最大可用内存
        System.out.println(r.freeMemory()/1024+"KB");
        System.out.println(r.totalMemory()/1024/1024+"MB");
    }
}
